package extends1moddifier;

public class Mod {

    //1.private:只能在本类中访问
    private void privateMethod()
    {
        System.out.println("privateMethod");
    }

    //2.default:只能在当前类和本包中访问
    void defaultMethod()
    {
        System.out.println("defaultMethod");
    }

    //3.protected:当前类，本包和子类中都可以访问
    protected void protectedMethod()
    {
        System.out.println("protectedMethod");
    }

    //4.public:任何地方都可以访问
    public void publicMethod()
    {
        System.out.println("publicMethod");
    }
}
